package zoo.reviewboard.user.validator;

import org.springframework.validation.Errors;
import org.springframework.validation.ValidationUtils;
import org.springframework.validation.Validator;

import zoo.product.domain.HitCommand;
import zoo.reviewboard.user.domain.ProductReviewBoardCommand;

public class ProReviewValidator implements Validator {

	
	public boolean supports(Class<?> clazz) {
		
		return HitCommand.class.isAssignableFrom(clazz); 
	}
	
	public void validate(Object target, Errors errors) {
		ValidationUtils.rejectIfEmptyOrWhitespace(errors, "pr_title", "required");
		ValidationUtils.rejectIfEmptyOrWhitespace(errors, "pr_content", "required");

	}
}
